import org.omg.CORBA.PUBLIC_MEMBER;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2023 —12 —03
 * Time: 19:10
 */
class Animal{
    public String name;
    public int age;

    public Animal(String name, int age){
        this.name = name;
        this.age = age;
    }

}

class Dog extends Animal{
    //继承了父类的成员变量，我们初始化一下
    public Dog(String name,int age){    //不明白为什么这么写，不初始化会报错，基础太差了
        super(name , age);
    }


    public void bark(){
        System.out.println(this.name + "汪汪叫");
    }


    public void eat(){
        System.out.println(this.name + "吃狗粮");
    }

}

class Cat extends Animal{
    public Cat (String name , int age){
        super(name , age);
    }

    public void miaomaio (){
        System.out.println(this.name + "猫叫");
    }

    public void eat(){
        System.out.println(this.name + "正在吃猫粮！");
    }

}



public class test1 {

    public static void main(String[] args) {
       Dog dog = new Dog("圆圆",19);
       dog.eat();
       dog.bark();
        System.out.println("=========================");

    }

}

